<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        var arr = [1,2,3,4];
        // console.log(arr.slice(0,2));
        // console.log(arr.slice());
        // (从该位开始截取，截取到该位)
        // (从该位开始截取截取到最后一位);
        var obj = {
            '0':'h',
            '1':'1',
            '2':'yang',
            '3':'heng',
            '4':'男',
            length:5,
            splice : Array.prototype.splice,
            puch : Array.prototype.push,
            slice : Array.prototype.slice
        }
        console.log(obj.slice());
        //可以将类数组转换成数组

        var str = '1,2,3,4';
        console.log(str.slice(0,1));

    </script>
</body> 
</html>